package com.jn.exam.question.service.impl;

import com.jn.exam.question.entity.Type;
import com.jn.exam.question.mapper.TypeMapper;
import com.jn.exam.question.service.TypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 江南大学1033190417
 * @since 2022-01-18
 */
@Service
public class TypeServiceImpl extends ServiceImpl<TypeMapper, Type> implements TypeService {

    @Override
    public boolean addOneType(String id,String type) {
        Map<String,Object> param=new HashMap<>();
        param.put("id",id);
        param.put("type",type);
        int add= baseMapper.addOneType(param);
        if (add==1){
            return true;
        }
        return false;
    }

    @Override
    public boolean addOneType(Type type) {
        return baseMapper.addType(type);
    }
}
